package at.fhooe.mc.msports;

import java.util.Vector;

import net.rim.device.api.database.Database;
import net.rim.device.api.ui.UiApplication;

public class Pedometer extends UiApplication {
	public static void main(String[] args) {
		// Create a new instance of the application and make the currently
		// running thread the application's event dispatch thread.
		Pedometer theApp = new Pedometer();
		theApp.enterEventDispatcher();
	}

	public Pedometer() {
		Database database;

		if (DBDaemon.isDatabaseAlive()) {
			database = DBDaemon.openDatabase();
		} else {
			database = DBDaemon.createDatabase();
		}

		if (database != null) {
			SessionManager.setDatabase(database);
			PersonalData.setDatabase(database);

			if(PersonalData.isEmpty())
				pushScreen(new InputScreen());
			else{
				PersonalData.loadData();
				pushScreen(new SessionScreen());
			}
				
		}
	}
}
